package com.pucheng.bracelet.app.network

import com.pucheng.bracelet.data.bean.*
import com.pucheng.bracelet.ui.adapter.WatchData
import com.zaaach.citypicker.model.City
import retrofit2.http.*

/**
 * 作者　: hegaojian
 * 时间　: 2019/12/23
 * 描述　: 网络API
 */
interface ApiService {

    companion object {
        const val SERVER_URL = "http://szpctek.com/"
        const val SERVER_URL1 = "https://wanandroid.com/"
    }

    /**
     * 屏保
     */
    @POST("open/index/screen")
    suspend fun getScreen(): ApiResponse<ListData<WatchData>>

    /**
     * 激活设备
     */
    @POST("open/index/device")
    @FormUrlEncoded
    suspend fun bindDervice(
        @Query("mac") mac: String,
        @Query("area") area: String
    ): ApiResponse<Any?>

    /**
     * 获取地区数据
     */
    @POST("open/index/city")
    suspend fun getArea(@Query("country") country: String,
                        @Query("city") city: String,
                        @Query("lat") lat: String,
                        @Query("lon") lon: String): ApiResponse<List<City>>

    /**
     * 获取帮助文档列表
     */
    @GET("open/index/help")
    suspend fun getHelp(): ApiResponse<ListData<FeedbackBean>>

    /**
     * 获取帮助文档详情
     */
    @GET("open/index/show")
    suspend fun getShowHelpDetails(@Query("id") id: String): ApiResponse<FeedbackBean>

    /**
     * 获取天气
     */
    @POST("open/index/weather")
    suspend fun getWeather(
        @Query("country") country: String,
        @Query("city") city: String,
        @Query("lat") lat: String,
        @Query("lon") lon: String
    ): ApiResponse<List<WeatherInfoBean>>

    /**
     * 获取版本升级
     */
    @GET("open/index/version")
    suspend fun getVersion(): ApiResponse<VersionBean>

}